
###  Plot Hegemonic Volatility Measure ### 



rm(list=ls()) 
 
library(foreign)

setwd("/Users/davidcarter/Dropbox/Systemic Crisis Rep/")


vol<-read.dta("systemic_yearly_summary2_old.dta")
attach(vol)




### PCA Measure ##


plot(c(1816,2001),range(pca_1),type="n",xlab="Year",ylab="Composite Systemic Instability Measure" , xaxt="n")

lines(year[1:186], pca_1[1:186],lwd=3)
axis(1, at = seq(1816, 2000, by = 4), las=2)

claims<-read.dta("yearly_claims_data.dta")
attach(claims)


par(new = T)
with(claims, plot(year[1:186], num_claims[1:186],lwd=2,lty=1,col="red",type="l", yaxt="n",xaxt="n",ylab="",xlab=""))
axis(side = 4)
mtext(side = 4, 'Number of Claim Onsets')

legend(1810,22,legend=c("Composite Measure of Systemic Instability"),lty=1,lwd=3,bty="n",cex=1.25)
legend(1810,20.5,legend=c("Number of Claim Onsets"), lty=1,lwd=2,bty="n",col="red",cex=1.25)


